package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.model.SetFudingModelImpl;
import com.sphd.beautysalon.view.SetFudingView;

/**
* Created by Hu on 2016/11/03
*/

public class SetFudingPresenterImpl implements SetFudingPresenter {
    private SetFudingView setFudingView;
    private SetFudingModelImpl setFudingModel;

    public SetFudingPresenterImpl(SetFudingView setFudingView) {
        this.setFudingView = setFudingView;
        setFudingModel=new SetFudingModelImpl();
    }

    @Override
    public void addData(String url) {
        setFudingView.showLoading();
        setFudingModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        setFudingView.dissLoading();
    }

    @Override
    public void sendRes(int res) {
        if (res==1){
            setFudingView.recResSucced();
        }else {
            setFudingView.recResFaik();
        }
        setFudingView.dissLoading();
    }
}